<nav class="navbar navbar-default" role="navigation">
    <div class="container">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#example-navbar-collapse">
            <span class="sr-only">切换导航</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
        </button>
            <a class="navbar-brand" href="#">ni blog</a>
        </div>
        <div class="collapse navbar-collapse" id="example-navbar-collapse">
            <ul class="nav navbar-nav navbar-left">
                <li><a href="">首页</a></li>
                <li><a href="">社区</a></li>
                <li><a href="">反馈</a></li>
            </ul>
            <ul class="nav navbar-nav navbar-right">
                {{ if user }}
                <a class="btn btn-default navbar-btn" href="/topics/new">发起</a>
                <li class="dropdown">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><img width="20" height="20" src="./public/img/avatar-default.png" alt="头像"> <span class="caret"></span></a>
                    <ul class="dropdown-menu">
                        <li class="dropdown-current-user">
                            当前登录用户: {{ user.nickname }}
                        </li>
                        <li role="separator" class="divider"></li>
                        <li><a href="#">个人主页</a></li>
                        <li><a href="/settings/profile">设置</a></li>
                        <li><a href="/logout">退出</a></li>
                    </ul>
                </li>
                {{ else }}
                <li><a href="/register"><span class="glyphicon glyphicon-user"></span> 注册</a></li>
                <li><a href="/login"><span class="glyphicon glyphicon-log-in"></span> 登录</a></li> {{ /if }}
            </ul>
        </div>
    </div>
</nav>